import { onMounted } from "vue";

export const getList = async (api: Promise<any>): Promise<any[]> => {
  // onMounted(async () => {
  try {
    const res = await api;
    return res.data.list;
  } catch (error) {
    console.error("Error fetching data:", error);
    return []; // 可以根据实际情况返回一个空数组或抛出错误
  }
  // });
};
